package com.stx.entity;

import java.util.Date;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;

@Entity
@Table(name="fc_small_comment")
@SequenceGenerator(name="sc_id",sequenceName="fi_id",initialValue=1,allocationSize=1)
public class Film_comment {

	@Id
	@Column(nullable=false)
    @GeneratedValue(generator="sc_id",strategy=GenerationType.SEQUENCE)
	private long sc_id;
	
	private String sc_countent;
	private long sc_score;
	private long sc_cai;
	private long sc_ding;
	private Date sc_time;
	
	@ManyToOne(cascade= {CascadeType.PERSIST,CascadeType.MERGE},fetch=FetchType.EAGER,optional=false)
    @JoinColumn(name="fi_id")
	private Film film;
	
	@ManyToOne(cascade= {CascadeType.PERSIST,CascadeType.MERGE},fetch=FetchType.EAGER,optional=false)
    @JoinColumn(name="us_id")
	private User user;
	
	
	
	
	public Date getSc_time() {
		return sc_time;
	}
	public void setSc_time(Date sc_time) {
		this.sc_time = sc_time;
	}
	public Film getFilm() {
		return film;
	}
	public void setFilm(Film film) {
		this.film = film;
	}
	public User getUser() {
		return user;
	}
	public void setUser(User user) {
		this.user = user;
	}
	public long getSc_id() {
		return sc_id;
	}
	public void setSc_id(long sc_id) {
		this.sc_id = sc_id;
	}
	public String getSc_countent() {
		return sc_countent;
	}
	public void setSc_countent(String sc_countent) {
		this.sc_countent = sc_countent;
	}
	public long getSc_score() {
		return sc_score;
	}
	public void setSc_score(long sc_score) {
		this.sc_score = sc_score;
	}
	public long getSc_cai() {
		return sc_cai;
	}
	public void setSc_cai(long sc_cai) {
		this.sc_cai = sc_cai;
	}
	public long getSc_ding() {
		return sc_ding;
	}
	public void setSc_ding(long sc_ding) {
		this.sc_ding = sc_ding;
	}
	
	
}
